from .serializer import BannerSerializer
from .models import Banner
from rest_framework.viewsets import GenericViewSet
from utils.view import CommonListModelMixin
from django.conf import settings
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework.permissions import IsAuthenticated


# Create your views here.


class BannerView(GenericViewSet, CommonListModelMixin):
    # authentication_classes = [JSONWebTokenAuthentication]
    # permission_classes = [IsAuthenticated]
    queryset = Banner.objects.all().filter(is_delete=False, is_show=True).order_by('orders')[:settings.BANNER_COUNT]
    serializer_class = BannerSerializer
